import { http } from '@/utils/http'
import { baseURLApi } from '../utils'

export type ToolPage = {
  pageSize: number
  currentPage: number
}
export type PageResult<T> = {
  total: number
  list: Array<T>
}

export type ToolVO = {
  id: number
  title: string
  tools: Array<Tool>
}

// 工具卡片接口定义
export interface Tool {
  id: string
  title: string
  description: string
  icon: string
  iconColor: string
  url?: string
}

export const getTool = (data: ToolPage) => {
  return http.request<PageResult<ToolVO>>('get', baseURLApi('/tool'), { params: data })
}
